package edu.uwosh.cs342.group5;


public class PlaceSearch {
	static String nearbyPlacesString = "https://maps.googleapis.com/maps/api/place/search/json?";
	static String placesDetailsString = "https://maps.googleapis.com/maps/api/place/details/json?";
	
	
	public static String nearbyPlaces(String key, double lat, double longs, boolean sensor, int radius){
		String stage = nearbyPlacesString + "key="+key+"&location="+lat+","+longs+"&sensor="+sensor+"&radius="+radius;
		
		String letssee;
		try {
			System.out.println(stage);
			letssee = CustomHttpClient.executeHttpGet(stage);
			System.out.println(letssee);
			return letssee;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
	
	public static String placeDetails(String key, String ref, boolean sensor){
		String stage = placesDetailsString +"key="+key+"&reference="+ref+"&sensor="+sensor;

		System.out.println("Details: ");
		String letssee;
		try {
			System.out.println("Details: ");
			System.out.println(stage);
			letssee = CustomHttpClient.executeHttpGet(stage);
			System.out.println(letssee);
			return letssee;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
}
